export const titleData = {
  1: '金球奖杯',
  2: '金靴奖杯',
  3: '独孤球败的称号'
}

export const calRatio = (score = 0) => {
  let ratio = 0
  if (score > 0 && score <= 5) {
    ratio = genRandom(1, 10)
  } else if (score > 5 && score <= 10) {
    ratio = genRandom(11, 30)
  } else if (score > 10 && score <= 15) {
    ratio = genRandom(31, 60)
  } else if (score > 15 && score <= 20) {
    ratio = genRandom(61, 70)
  } else if (score > 20 && score <= 25) {
    ratio = genRandom(71, 80)
  } else if (score > 25 && score <= 30) {
    ratio = genRandom(81,90)
  } else if (score > 30 && score <= 35) {
    ratio = genRandom(91, 95)
  } else if (score > 35) {
    ratio = genRandom(96, 100)
  }
  return `${ratio}%`
}

const genRandom = (start = 1, end = 10) => {
  const diff = end - start
  const num = Math.ceil(Math.random() * diff) + start
  return num
}
